/*
 * Copyright (c) 2009, Jan Pastor. All Rights Reserved.
 */

package sk.jp.jitag.pok1;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import sk.jp.commons.utils.LogMsg;
import sk.jp.jitag.pok1.gui.Pok1MainWindow;
import sk.jp.jitag.util.Property;

@Component
public class Pok1 {

    private static final Logger log = LoggerFactory.getLogger(Pok1.class);

    @Autowired
    private Initializer initializer;

    //----------------------------------------------------------------------

    public void run() {
        log.debug(LogMsg.inp());
        log.trace(LogMsg.toString("Params", Property.defaultThumbSize.name(),
                                  Property.defaultThumbSize));
        try {
            initializer.init();
            Pok1MainWindow mainWindow = new Pok1MainWindow();
            mainWindow.open();
        } catch (Exception e) {
            log.error("Unexpected exception", e);
        }
        log.trace(LogMsg.out());
    }

}
